<script>

// 续费开始modal
function renewTime(uid){
        $("#renew_uid").val(uid);        
        $('#renewModal').modal();
}

// 修改服务经理modal
function modifyServicePerson(uid,serviceId) {
    $("#modify_service_uid").val(uid);
    $("#service_person_id").val(serviceId);
    $('#modifyServicePerModal').modal();
}

// 续费资料收集完成modal
function renewCollectDone(uid) {
    $("#collect_done_uid").val(uid);
    $('#collectDoneModal').modal();
}

// 审核再申请modal
function auditReApply(uid) {
    $("#audit_reapply_uid").val(uid);
    $('#auditReApplyModal').modal();
}

$(function(){
    
    // 续费开始
    $("#save_renew_time").click(function(){
        var uid = $("#renew_uid").val();
        
         cAjax({
                    url:  "/crm/member/renewBegin",
                    data: {uid:uid},
                    success: function(data){
                                if(data.result) {
                                     $('#renewModal').modal('hide');
                                    greeting({msg:"操作成功！", confirm:function(){
                                        location.reload();
                                    }});                                
                                } else {
                                    greeting({msg:"<h4 style=\"color:red\">失败，有错误！</h4>",title:"操作失败"});
                                }
                     },
                    error: function(obj) {
                    }
        }); 
                
    });
    
    // 修改服务经理
    $("#save_modify_service").click(function(){
        var uid = $("#modify_service_uid").val();
        var service_id = $("#service_person_id").val();
        
        cAjax({
                    url:  "/crm/member/modyfyServPer",
                    data: {uid:uid, service_id:service_id},
                    success: function(data){
                                if(data.result) {
                                     $('#modifyServicePerModal').modal('hide');
                                    greeting({msg:"操作成功！", confirm:function(){
                                        location.reload();
                                    }});                                
                                } else {
                                    greeting({msg:"<h4 style=\"color:red\">失败，有错误！</h4>",title:"操作失败"});
                                }
                     },
                    error: function(obj) {
                    }
        }); 
               
    });
    
    // 续费资料收集完成
    $("#collect_done_save").click(function(){
        var uid = $("#collect_done_uid").val();
        
         cAjax({
                    url:  "/crm/member/renewCollectDone",
                    data: {uid:uid},
                    success: function(data){
                                if(data.result) {
                                     $('#collectDoneModal').modal('hide');
                                    greeting({msg:"操作成功！", confirm:function(){
                                        location.reload();
                                    }});                                
                                } else {
                                    greeting({msg:"<h4 style=\"color:red\">失败，有错误！</h4>",title:"操作失败"});
                                }
                     },
                    error: function(obj) {
                    }
        }); 
      
    });
    
    // 申请再审核
    $("#audit_reapply_save").click(function(){        
        var uid = $("#audit_reapply_uid").val();
        
         cAjax({
                    url:  "/crm/member/auditReApply",
                    data: {uid:uid},
                    success: function(data){
                                if(data.result) {
                                     $('#auditReApplyModal').modal('hide');
                                    greeting({msg:"操作成功！", confirm:function(){
                                        location.reload();
                                    }});                                
                                } else {
                                    greeting({msg:"<h4 style=\"color:red\">失败，有错误！</h4>",title:"操作失败"});
                                }
                     },
                    error: function(obj) {
                    }
        }); 
        
    });
    
});

</script>